#ifndef SETTINGGRIDDIALOG_H
#define SETTINGGRIDDIALOG_H

#include <QDialog>
#include "abstractplot2d.h"

class ColorButton;

namespace Ui {
    class SettingGridDialog;
}

class SettingGridDialog : public QDialog {
    Q_OBJECT
public:
    SettingGridDialog(QWidget *parent = 0);
    ~SettingGridDialog();
    void setPlotter(AbstractPlot2D *plotter);

private slots:
    void apply();
    void changeAxis(int currentRow);
    void changePenStyleMajorGrid(int index);
    void changePenStyleMinorGrid(int index);
    void changePenWidthMajorGrid(int value);
    void changePenWidthMinorGrid(int value);
    void changeColorMajorGrid(const QColor &color);
    void changeColorMinorGrid(const QColor &color);
    void changeShowMajorGrid(bool isShow);
    void changeShowMinorGrid(bool isShow);

protected:
    void changeEvent(QEvent *e);

private:
    Ui::SettingGridDialog *ui;
    AbstractPlot2D *_plotter;
    ColorButton *colorMajorGridBtn;
    ColorButton *colorMinorGridBtn;
    Grid gridX;
    Grid gridY;

};

#endif // SETTINGGRIDDIALOG_H
